﻿using System;
using System.Collections.Generic;
using System.Linq;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Audio;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.GamerServices;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;
using Microsoft.Xna.Framework.Media;

namespace GameDev_Story.Cenas
{
    public class Cena_Ajuda
    {
        Texture2D fundo;
        Texture2D help;
        GameWindow Window;
        Vector2 posicao = new Vector2(0, 0);                

        public Cena_Ajuda(ContentManager Content, GameWindow Window)
        {
            this.Window = Window;
            fundo = Content.Load<Texture2D>("ajuda");
            help = Content.Load<Texture2D>("help");
        }

        public void Update(GameTime gameTime, KeyboardState teclado_atual, KeyboardState teclado_anterior, GamePadState joystick_atual, GamePadState joystick_anterior)
        {
            if (teclado_atual.IsKeyDown(Keys.Right) && !teclado_anterior.IsKeyDown(Keys.Right) ||
                joystick_atual.IsButtonDown(Buttons.DPadRight) && !joystick_anterior.IsButtonDown(Buttons.DPadRight))
            {
                posicao.X = -800;                
            }

            if (teclado_atual.IsKeyDown(Keys.Left) && !teclado_anterior.IsKeyDown(Keys.Left) ||
                joystick_atual.IsButtonDown(Buttons.DPadLeft) && !joystick_anterior.IsButtonDown(Buttons.DPadLeft))
            {
                posicao.X = 0;
            }
        }

        public void Draw(GameTime gameTime, SpriteBatch spriteBatch)
        {
            spriteBatch.Draw(fundo,posicao, Color.White);
            spriteBatch.Draw(help, new Vector2(0, 550), Color.White);
        }
    }
}
